Note: This statement is named Raise Error in the Add Statement dialog box.
Generates a script error. This statement can be used in a Try block. See Try...Catch...Finally.
Syntax
Raise(Number, "Source", "Description")
Arguments
| Argument | Description |
|---|---|
| Number | Error code. |
| Source | Optional text string to indicate where in the script the error occurred. |
| Description | Optional error description. |
Supported objects
Err
Example
Function FunctionThatFails()
Err.Raise(100, "FailedFunction", "Function fails")
End Function
On Error Resume Next
FunctionThatFails()
If Err.Number() <> 0 Then
errMsg = "Error: Number = " + Err.Number()
errMsg = errMsg + ", Source = " + Err.Source()
errMsg = errMsg + ", Description = " + Err.Description()
PrintLn(errMsg)
Err.Clear()
End If